Contactless tags are often used as a product identification and traceability means. Within this context, different parties can be required to write or read data saved in the tags. For example, after affixing a contactless tag on the product he has just manufactured, a manufacturer writes in the memory of the integrated circuit of the tag the serial number of the product, the model and the type of product, its manufacturing date, etc. The distributor of the same product then writes data of his own in the tag, for example the purchase date, the trade references of the product, the destination of the product, etc. Finally, the retailer may also wish to write data of his own in the tag, for example the date of receipt of the product, the purchase price and the retail price of the product, etc. Therefore, three different users must share the memory space of the integrated circuit.
So that the data written by each user are protected against access attempts by unauthorized third parties, provision is usually made for a password-based protection system. Many contactless integrated circuits thus have a single password that must be presented before each access to the memory. However, to avoid the same password being shared by several users, one well-known method also involves dividing the memory space into several sectors which can each be protected by a determined password.
FIG. 1 schematically shows the structure of an RFID-type (Radio Frequency Identification) contactless integrated circuit IC1 using several passwords. The integrated circuit comprises a contactless communication interface circuit ICT, a control circuit CCT1 and an electrically erasable and programmable memory MEM1. The interface circuit ICT is linked to an antenna circuit ACT for contactlessly receiving or sending data. The control circuit CCT1 receives, via the interface circuit ICT, read or write commands CMD for writing or reading the memory, and returns responses RSP via the circuit ICT. The memory MEM1 comprises a user memory area UMEM and a system memory area SMEM, represented by a hatched area. The system area generally comprises data used by the control circuit CCT1 to implement the contactless communication protocol.
The user memory area UMEM is split into several sectors of the same size, for example three sectors S1, S2, S3 which can generally each receive from a few tens to a few hundred bytes. In each sector S1, S2, S3 there is a reserved location receiving a password, respectively pw1, pw2, pw3.
Each memory is accessed, for example for reading or writing a word, by sending to the integrated circuit a read or write command comprising the address of the word (including the address of the sector in which the word is located) and the password of the sector. Before executing the command, the circuit CCT1 reads the password in the sector and compares it with the password present in the command. If the result of the comparison is positive, the command is executed. In the opposite case, the circuit CCT1 returns an error code.
Upon commissioning the integrated circuit IC1, the memory area UMEM is blank and the passwords are equal to a default value, generally 0. The first user chooses one of the sectors, generally the first sector S1, writes his password and then the data of the application in it. The second user does the same with the sector S2 and the third user does the same with the last sector S3. Each user thus has a reserved memory space protected by a password and can access it at will to read or write data.
However, this method for sharing the memory space has various disadvantages. Firstly, partitioning the memory space into sectors of the same size does not enable the memory space to be optimally occupied, due to the fact that each user does not necessarily have the same number of data to write. Thus, one user may only use a small portion of the sector he was allocated, while another user may be restricted by the lack of space of the sector he is allocated. In this case, the memory space unused by the first user cannot be used by the second user, hence a significant waste of memory space.
Furthermore, a user (for example, the manufacturer) may want another user (for example, the wholesaler) to be able to selectively read certain data he has saved in the memory, but not all the data.
To meet this need, it is possible to subdivide the user memory space UMEM into smaller sectors that are greater in number, for example fifteen sectors instead of three. Thus, if the needs of the first user are slight in terms of memory space, the first user will only use a small number of sectors, the rest of the memory space being made available to the other users. Moreover, the first user can reveal the passwords of certain sectors to the other users, so that the latter can read these sectors.
However, this solution has a major disadvantage: when the number of sectors increases, the number of passwords increases proportionately as well as the percentage of the memory space occupied by the passwords that may each include several bytes.